package com.sanuo.pico.act.work;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.sanuo.pico.R;
import com.sanuo.pico.event.Event;
import com.sanuo.pico.event.LevelState;
import com.sanuo.pico.event.LimitState;
import com.sanuo.pico.it.SettingPage;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class LimitAct extends RentAct implements SettingPage {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding.title.setText(getResources().getStringArray(R.array.settings)[8]);

        onMessageEvent(Event.limit);
    }

    @Override
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(LevelState event) {
        //do nothing
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(LimitState event) {
        setState(event.getValue());
    }
}
